/*
 *
 *      Copyright (c) 2018-2025, st All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: st
 *
 */

package com.mkh.st.admin.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mkh.st.admin.api.dto.*;
import com.mkh.st.admin.api.entity.SysUser;
import com.mkh.st.admin.api.vo.*;
import com.mkh.st.common.core.util.R;
import com.mkh.st.purchase.vo.PurchaseGroupVO;
import com.mkh.st.purchase.vo.SupplierVO;
import com.mkh.st.warehouse.vo.WarehouseFeignVO;

import java.util.List;

/**
 * @author st
 * @date 2017/10/31
 */
public interface SysUserService extends IService<SysUser> {

	/**
	 * 查询用户信息
	 * @param sysUser 用户
	 * @return userInfo
	 */
	UserInfo findUserInfo(SysUser sysUser);

	Boolean lockUserStatus(UserLockDTO dto);

    R<IPage<UserPageVO>> getUserPage(Page page, UserPageDTO dto);

	R<UserDetailVO> getUserDetail(Long userId);

	Boolean saveUserInfo(UserSaveDTO dto);

	Boolean updateUserPassword(UserPasswordDTO dto);

	Boolean copyUserDataScope(UserCopyDataScopeDTO dto);

	List<UserRoleScopeListVO> getUserRoleScopeList(UserRoleScopeDTO dto);

	List<ScopeDataDeatil> getUserScopeDataList(UserRoleDataDTO dto);

	Boolean userScopeDataSave(UserRoleDataSaveDTO dto);

	//数据权限合并 type=0实时权限，1缓存权限
	DataPermissionVO getDataPermisston(Integer type, String menuCode, List<Long> scopeIds);

	DataPermissionVO getUserDataPermisstion(String docTypeCode, String menuCode);

	Page<UserPurchasePageVO> purchaseUserPage(UserPurchasePageDTO dto);

	List<UserPurchasePageVO> purchaseUserList(UserPurchasePageDTO dto);

	Long otherUserSave(OtherUserDTO dto);

	Boolean deleteUser(DeleteDto dto);

	List<UserPageVO> getUserList(UserPageDTO dto);

	List<UserIdNameVO> getUserNameList(String ids);

	List<UserIdNameVO> getSaleUserList(Integer businessType);

	List<UserIdNameVO> getPurchaseUserList(String keyWord);

	List<UserIdNameVO> getUsersList(String keyWord, Integer userType, String menuCode);

	List<PurchaseGroupVO> getPurchaseGroupList(String menuCode,Long siteId);

	List<SupplierVO> getSupplierList(String menuCode);

	List<UserIdNameVO> getAllUsersList(String keyWord, String menuCode);

	List<String> getPermissionList();

	UserDetailVO getUserDetailScope(Long userId);

	Boolean checkUserPermission(String menuCode,Long scopeId, String name);

	Boolean addScopeData(ScopoDataDTO dto);
}
